package com.playmodule.vr.projections;

public class ProjectionFactory {
    public static final float DEFAULT_ASPECT_RATIO = 1.33F;
    public static final int PROJECTION_CUBE = 4;
    public static final int PROJECTION_CYLINDER = 5;
    public static final int PROJECTION_DOME = 2;
    public static final int PROJECTION_FULL_DOME = 3;
    public static final int PROJECTION_PLANE = 0;
    public static final int PROJECTION_SPHERE = 1;
    private static ProjectionFactory instance;
    private boolean mAmbilight;
    private CylinderProjectionSettings mCylinderSettings = new CylinderProjectionSettings();
    private DomeProjectionSettings mDomeSettings = new DomeProjectionSettings();
    private FullDomeProjectionSettings mFullDomeSettings = new FullDomeProjectionSettings();
    private SphereProjectionSettings mSphereSettings = new SphereProjectionSettings();

    public static ProjectionFactory getInstance() {
        if (instance == null) {
            instance = new ProjectionFactory();
        }
        return instance;
    }

    public Projection Create(int paramInt1, int paramInt2, float paramFloat) {
        switch (paramInt1) {
            default:
                return new PlaneProjection(paramInt2, paramFloat, this.mAmbilight);
            case 0:
                return new PlaneProjection(paramInt2, paramFloat, this.mAmbilight);
            case 1:
                return new SphereProjection(paramInt2, this.mSphereSettings);
            case 2:
                return new DomeProjection(paramInt2, this.mDomeSettings, this.mAmbilight);
            case 3:
                return new FullDomeProjection(paramInt2, this.mFullDomeSettings, this.mAmbilight);
            case 4:
                return new CubeProjection(paramInt2);
            case 5:
                return new CylinderProjection(paramInt2, this.mCylinderSettings, true);
            case 6:
                return new MyCylinderProjection(paramInt2, this.mSphereSettings);
            case 7:
                return new HalfSphereProjection(paramInt2, this.mSphereSettings);
            case 8:
                return new HalfCylinderProjection(paramInt2,this.mSphereSettings);
        }
    }

    public Projection CreateDefault() {
        return Create(4, 0, 1.33F);
    }

    public void setAmbilight(boolean paramBoolean) {
        this.mAmbilight = paramBoolean;
    }

    public void setCylinderSettings(float paramFloat1, float paramFloat2, int paramInt1, int paramInt2) {
        this.mCylinderSettings.scale = paramFloat1;
        this.mCylinderSettings.angle = paramFloat2;
        this.mCylinderSettings.slices = paramInt1;
        this.mCylinderSettings.stacks = paramInt2;
    }

    public void setDomeSettings(float paramFloat1, float paramFloat2, int paramInt1, int paramInt2) {
        this.mDomeSettings.horizontalCoverage = paramFloat1;
        this.mDomeSettings.verticalCoverage = paramFloat2;
        this.mDomeSettings.slices = paramInt1;
        this.mDomeSettings.stacks = paramInt2;
    }

    public void setFullDomeSettings(float paramFloat1, float paramFloat2, float paramFloat3, int paramInt1, int paramInt2) {
        this.mFullDomeSettings.coverage = paramFloat1;
        this.mFullDomeSettings.tilt = paramFloat2;
        this.mFullDomeSettings.heading = paramFloat3;
        this.mFullDomeSettings.slices = paramInt1;
        this.mFullDomeSettings.stacks = paramInt2;
    }

    public void setSphereSettings(float paramFloat1, float paramFloat2, float paramFloat3, int paramInt1, int paramInt2) {
        this.mSphereSettings.width = paramFloat1;
        this.mSphereSettings.height = paramFloat2;
        this.mSphereSettings.depth = paramFloat3;
        this.mSphereSettings.slices = paramInt1;
        this.mSphereSettings.stacks = paramInt2;
    }
}
